<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>排行榜</title>
    <style>
        body {
            font-family: 'Arial', sans-serif;
        }
        table {
            width: 100%;
            border-collapse: collapse;
        }
        th, td {
            padding: 10px;
            border: 1px solid #ddd;
            text-align: left;
        }
        th {
            background-color: #f2f2f2;
        }
        tr:nth-child(even) {
            background-color: #f9f9f9;
        }
        .positive {
            color: green;
        }
        .negative {
            color: red;
        }
    </style>
</head>
<body>

<h2>排行榜</h2>

<table>
    <tr>
        <th>排名</th>
        <th>用户ID</th>
        <th>昵称</th>
        <th>总分数</th>
    </tr>
    <!-- 表格内容将从这里开始 -->
    {{range $key,$value := .data}}
    <tr>
        <td>{{ $value.Ranking }}</td>
        <td>{{ $value.UserId }}</td>
        <td>{{ $value.NickName }}</td>
        <td>{{ $value.TotalMark }}</td>
    </tr>
    {{end}}
    <!-- 表格内容结束 -->
</table>

</body>
</html>